package com.wxzhou.wangzhuan.entity;

/**
 * 审核状态枚举
 */
public enum AuditStatus {
    /**
     * 提现中
     */
    PENDING(1, "等待审核"),
    
    /**
     * 通过
     */
    APPROVED(2, "通过"),
    
    /**
     * 拒绝
     */
    REJECTED(3, "拒绝");

    private final int code;
    private final String description;

    AuditStatus(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static AuditStatus fromCode(int code) {
        for (AuditStatus status : AuditStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown audit status code: " + code);
    }

    @Override
    public String toString() {
        return description;
    }
}